import lejos.nxt.Button;
import lejos.nxt.LightSensor;
import lejos.nxt.SensorPort;


public class Vehicle2b extends Behavior {
	LightSensor l1 = new LightSensor(SensorPort.S2);
	LightSensor l2 = new LightSensor(SensorPort.S3);
	
	public Vehicle2b(String name, int LCDrow, Behavior b)
    {
    	super(name, LCDrow, b);
	}
	
	public void run(){
		int defaultSpeed = 30;
    	
		while(true){
			suppress();
			int speed1 = (l1.readNormalizedValue()-500)/2;
			int speed2 = (l2.readNormalizedValue()-500)/2;
//			LCD.drawInt(speed1, 0, 0);
//			LCD.drawInt(speed2, 1, 1);
			forward(defaultSpeed + speed1,defaultSpeed + speed2);
			
			release();
		}
	}
	
}